function [dataScaling, mu, sigma] = featureNormalize(data,mu,sigma)

if(nargin < 2)
    mu = min(data, [], 1);
    sigma = max(data, [], 1) - mu;        
end

dataScaling = (data - repmat(mu, size(data, 1), 1)) ./ repmat(sigma, size(data, 1), 1);
end
